﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CCWin;
namespace weiqijiance.工位配置
{
    public partial class WEsetting : CCSkinMain
    {
        public WEsetting()
        {
            InitializeComponent();
        }

        private void WEsetting_Load(object sender, EventArgs e)
        {
            iniclass objini = new iniclass();
            string path = "";
            path = System.Windows.Forms.Application.StartupPath + path + "\\安综检仪表配置.ini";
            string path1 = string.Format(@"{0}", path);
            objini.Ini(path1);
            textBox1.Text = objini.ReadValue("轮重", "检测时间").Trim();
            textBox2.Text = objini.ReadValue("轮重", "信息显示时间").Trim();
            che_ddzj.Checked = objini.ReadValue("轮重", "只检单独综检").Trim().Contains("是") ? true : false;
            che_bhzbzl.Checked = (objini.ReadValue("轮重", "包含整备质量").Trim() == "1") ? true : false;
            che_jgblxx.Checked = objini.ReadValue("轮重", "结果采用比例显示").Trim().Contains("是") ? true : false;
            che_VideoOff.Checked = objini.ReadValue("轮重", "轴重不录像").Contains("是") ? true : false;
            tb_waiting.Text = objini.ReadValue("轮重", "等待视频录制时间").Trim();
            cb_picoff.Checked = objini.ReadValue("轮重", "轴重不抓拍").Contains("是") ? true : false;
            cb_weighty.Checked = objini.ReadValue("轮重", "摩托车使用右轮重").Contains("是") ? true : false;
            cb_zbzlpd.Checked = objini.ReadValue("轮重", "空车质量不进行评判").Contains("是") ? true : false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            iniclass objini = new iniclass();
            string path = "";
            path = System.Windows.Forms.Application.StartupPath + path + "\\安综检仪表配置.ini";
            string path1 = string.Format(@"{0}", path);
            objini.Ini(path1);
            objini.Writue("轮重", "检测时间", textBox1.Text);
            objini.Writue("轮重", "信息显示时间", textBox2.Text);
            //objini.Writue("轮重", "轴重制动重叠检测", checkBox1.Checked ? "1" : "0");
            objini.Writue("轮重", "只检单独综检", che_ddzj.Checked ? "是" : "否");
            objini.Writue("轮重", "包含整备质量", che_bhzbzl.Checked ? "1" : "0");
            objini.Writue("轮重", "结果采用比例显示", che_jgblxx.Checked ? "是" : "否");
            objini.Writue("轮重", "轴重不录像", che_VideoOff.Checked ? "是" : "否");
            objini.Writue("轮重", "等待视频录制时间", tb_waiting.Text);
            objini.Writue("轮重", "轴重不抓拍", cb_picoff.Checked ? "是" : "否");
            objini.Writue("轮重", "摩托车使用右轮重", cb_weighty.Checked ? "是" : "否");
            objini.Writue("轮重", "空车质量不进行评判", cb_zbzlpd.Checked ? "是" : "否");
            MessageBox.Show("完成");
            基类窗体.UploadAndDownload fupload = new 基类窗体.UploadAndDownload();
            objini.Ini(System.Windows.Forms.Application.StartupPath + "\\系统信息.ini");
            string sjcxname = objini.ReadValue("系统信息", "检测线名称");
            string sgongweiname = objini.ReadValue("系统信息", "检测工位名称");
            fupload.upload(sjcxname, sgongweiname, "安综检仪表配置.ini");
        }
    }
}
